package com.yunji.framework_template.orm.persistence.model;

import java.util.Date;

import com.yunji.framework_template.common.http.Base64Helper;
import com.yunji.framework_template.common.util.AES;

public class SitesInfo {

    private Integer id;

    private String  name;

    private Integer typeId;

    private String  ownerId;

    private String  ico;

    private String  screenshot;

    private String  title;

    private String  url;

    private Integer visits;

    private Integer likes;

    private Integer dislikes;

    private Date    added;

    private String  description;

    private String  keywords;

    private Boolean active;

    private Integer seq;

    private String  encryptId;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
        this.encryptId = Base64Helper.encode(AES.encrypt(id));
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    public String getOwnerId() {
        return ownerId;
    }

    public void setOwnerId(String ownerId) {
        this.ownerId = ownerId;
    }

    public String getIco() {
        return ico;
    }

    public void setIco(String ico) {
        this.ico = ico;
    }

    public String getScreenshot() {
        return screenshot;
    }

    public void setScreenshot(String screenshot) {
        this.screenshot = screenshot;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getVisits() {
        return visits;
    }

    public void setVisits(Integer visits) {
        this.visits = visits;
    }

    public Integer getLikes() {
        return likes;
    }

    public void setLikes(Integer likes) {
        this.likes = likes;
    }

    public Integer getDislikes() {
        return dislikes;
    }

    public void setDislikes(Integer dislikes) {
        this.dislikes = dislikes;
    }

    public Date getAdded() {
        return added;
    }

    public void setAdded(Date added) {
        this.added = added;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    public Integer getSeq() {
        return seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }

    public String getEncryptId() {
        if (this.encryptId == null) {
            this.encryptId = Base64Helper.encode(AES.encrypt(id));
        }
        return this.encryptId;
    }

    /**
     * 生成加密的ID
     */
    public void doEntryptId() {
        if (this.encryptId == null) {
            this.encryptId = Base64Helper.encode(AES.encrypt(id));
        }
    }

}
